<div class="layui-layout layui-layout-admin" style="padding-left: 40px;margin-top: 20px;">
    <form class="layui-form" >
        <div class="text">
            <h2 style = "text-indent:6em"> 
                修改用户【
                <font color="#104E8B" id = "uctrname"></font>
                】的密码
            </h2>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width:100px;">游戏推广号：</label>
 
            <div class="layui-form-mid">
                <font  id = "uctrlinfo"></font>
            </div>
        </div> 
        <div class="layui-form-item password" >
            <label class="layui-form-label"  style="width:100px;">新密码</label>
            <div class="layui-input-inline">
                <input type="password" name="password_new1" id="password_new1" lay-verify="required" autocomplete="off"  class="layui-input" value="" maxlength="16">
            </div>
        </div>

        <div class="layui-form-item password" >
            <label class="layui-form-label"  style="width:100px;">重复密码</label>
            <div class="layui-input-inline">
                <input type="password" name="password_new2" id="password_new2" lay-verify="required" autocomplete="off" class="layui-input" value="" maxlength="16">
            </div>
        </div> 
        <div class="layui-form-item" >
            <label class="layui-form-label"  style="width:100px;">操作理由</label>
            <div class="layui-input-block">
                    <textarea style="height:100px;width:400px" name="ctrlreson" id="ctrlreson" placeholder="请输入内容" lay-verify="required" class="layui-textarea" maxlength="127"></textarea>
            </div>    
        </div>


        <div class="layui-form-item" >
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="useroprater">确定修改</button>
            </div>
        </div>
    </form>
</div>
<script>
var $;
    layui.config({
            base : "js/"
    }).use(['form','element','layer','jquery'],function(){
        var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功
        var $ = layui.jquery;

        ShowContlrDatas();
        form.on('submit(useroprater)', function(data){
            var szReson = document.getElementById("ctrlreson");
            var szPass1 = document.getElementById("password_new1");
            var szPass2 = document.getElementById("password_new2");
            if (szPass1.value != szPass2.value){
                layer.msg("两次密码不一致！");
                 return false;
            }
            if (szPass1.value.toString().length < 6) {
                 layer.msg("密码少于6位！");
                 return false;
            }
            var form_data = {
                'uCtrlType': [|.uCtrlType|]
                ,'uCtrlUserID': localStorage["gameid"]
                ,'uCtrNickName': localStorage["unickname"]
                ,'upass1': szPass1.value
                ,'upass2': szPass2.value
                ,'uCtrlReaSonStr': szReson.value
            }
            layer.confirm('您确定要修改：【'+ localStorage["unickname"]+'】的密码吗？', function(index){
                $.post('[|urlfor "UsersFinduserController.UserContrlInfo"|]', form_data, function (out) {
                    if (out.status == 0) {
                        layer.msg(out.message,{icon: 1},function () {
                            window.location.reload()
                        })
                    } else {
                        layer.msg(out.message)
                    }
                }, "json");
            });
            return false;
        });
    return false;
}); 
function ShowContlrDatas(){
    var uctrlinfo =  document.getElementById("uctrname");
    uctrlinfo.innerHTML=localStorage["unickname"];
    var datas =  document.getElementById("uctrlinfo");
    datas.innerHTML=localStorage["gameid"];
}
</script>